Wikihack:WikiBot
Bots on Wikihack A wikiBot is a set of small programs (scripts) that automate wiki editing tasks. You should use a bot if you have a large number of edits that you need to perform. The bot takes care of repetitive and mundane tasks so you don't have to. Writing bot scripts requires good programming skills, but operating a bot is relativly easy. On Wikihack anyone can run a bot. However, you must notify us on the Forum before doing so. It's considered good manners to run the bot from its own user account, usually Bot. Bot Setup Wikihack uses MediaWiki, the same software that runs wikipedia. Therefore the pywikipedia bot can be used on Wikihack. 'pywikipedia' is written in the Python scripting language. If you are not familiar with Python, Dive Into Python provides a quick introduction along with links to ActiveState where you can download a free turn-key install package for most platforms. Wikihack Setup # Create the bot account. ## Use Bot as the username. ## Write down the password. # Ensure the display skin is set to Monobook (deafult skin). # Log out you bot account. Downloading pywikipedia The pywikipedia bot does not have a turn-key install. It has to be downloaded and configured. The best way to get the latest release is via CVS. Once you have acquired the bot you'll need to configure it before it will run on Wikihack. # Download and install Python. ActiveState has a good package # Download and install CVS. TortoiseCVS is a good package for MS Windows. ## Read TortoiseCVS User's Guide - Chapter 2. Checking out a Module ## Checkout pywikipedia. Refer to CVS Connection Parameters below. ## or paste into CVSROOT field :pserver:anonymous@pywikipediabot.cvs.sourceforge.net:/cvsroot/pywikipediabot Configuring pywikipedia Because Wikihack is not wikipedia, the bot needs some additional code to work properly. Wikipedia has information on workarounds for non-wikipedia wikis. Basically we'll need to add a 'families' definition for Wikihack before attempting to login. # Check if \families\wikihack_family.py exists. ## If it does not, add wikihack_family.py (see below) to the families directory. # Create \user-config.py (see below) Logging in pywikipedia We start by giving the bot login access to the wiki. This is a one time procedure. Once logged in the bot will store the username and password in a cookie for future use. To cache a different user/pass combination delete the XX-login.data file that is created in the login-data subdirectory. # Run command line python login.py -pass:XXXX pywikipedia: Upload * Run command line python upload.py -log -keep "" user-config.py mylang = 'en' family = 'wikihack' usernames'wikihack''en' = 'ExampleBot' wikihack_family.py # -*- coding: utf-8 -*- import family # The wikiHack family - a wiki about the game NetHack. # v1.0 - July 30, 2006. Bernard Martis class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'wikihack' # family name, same as filename self.langs = { 'en': 'nethack.wikia.com', # Wikihack hostname } self.mainpages = { 'en': u'Main Page' } # namespace not specified will be set to MediaWiki defaults # Project namespace. All languages use the same project namespace name. self.namespaces4 = { '_default': u'Wikihack', } # Project talk namespace. self.namespaces5 = { '_default': u'Wikihack talk', } # A few selected big languages for things that we do not want to loop over # all languages. This is only needed by the titletranslate.py module, so # if you carefully avoid the options, you could get away without these # for another wiki family. self.biglangs = 'en' # MediaWiki version used. Current as of Sun, 30-Jul, 06 def version(self, code): return "1.5" # The path of index.php def path(self, code): return '/index.php' # hostname. The same for all languages def hostname(self, code): return 'nethack.wikia.com' Category:Wikihack